home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 3 / csmp-digest-v3-118 < prev    next >
Text File  |  1995-12-31  |  51KB  |  1,305 lines

  1. C.S.M.P. Digest             Wed, 25 Oct 95       Volume 3 : Issue 118
  2.  
  3. Today's Topics:
  4.  
  5.         Accessing color table for PICT
  6.         Apple Event: How to get Address of sender
  7.         Calling a PPC trap not in InterfaceLib
  8.         Custom Palettes with GWorld & Picts...
  9.         Pixel data -> GWorld possible?
  10.         Sound Timing Question
  11.         What is the most current electronic reference?
  12.         [Q] How to notify Finder of renamed files?
  13.         how to identify cd volumes
  14.  
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  18. (pottier@clipper.ens.fr).
  19.  
  20. The digest is a collection of article threads from the internet newsgroups
  21. comp.sys.mac.programmer.help, csmp.tools and csmp.misc. It is designed for
  22. people who read news semi-regularly and want an archive of the discussions.
  23. If you don't know what a newsgroup is, you probably don't have access to
  24. it. Ask your systems administrator(s) for details. If you don't have access
  25. to news, you may still be able to post messages to the group by using a
  26. mail server like anon.penet.fi (mail help@anon.penet.fi for more
  27. information).
  28.  
  29. Each issue of the digest contains one or more sets of articles (called
  30. threads), with each set corresponding to a 'discussion' of a particular
  31. subject.  The articles are not edited; all articles included in this digest
  32. are in their original posted form (as received by our news server at
  33. nef.ens.fr).  Article threads are not added to the digest until the last
  34. article added to the thread is at least two weeks old (this is to ensure that
  35. the thread is dead before adding it to the digest).  Article threads that
  36. consist of only one message are generally not included in the digest.
  37.  
  38. The digest is officially distributed by two means, by email and ftp.
  39.  
  40. If you want to receive the digest by mail, send email to listserv@ens.fr
  41. with no subject and one of the following commands as body:
  42.     help                                Sends you a summary of commands
  43.     subscribe csmp-digest Your Name     Adds you to the mailing list
  44.     signoff csmp-digest                 Removes you from the list
  45. Once you have subscribed, you will automatically receive each new
  46. issue as it is created.
  47.  
  48. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  49. Questions related to the ftp site should be directed to
  50. scott.silver@dartmouth.edu.
  51.  
  52. -------------------------------------------------------
  53.  
  54. >From Melissa.Hines@Cornell.edu (Melissa A. Hines)
  55. Subject: Accessing color table for PICT
  56. Date: Sat, 07 Oct 1995 08:31:17 -0500
  57. Organization: Cornell University
  58.  
  59. The subject says it all:
  60.  
  61. How do I get a hold of the color table for a given PICT? I need to change
  62. it within my program.
  63.  
  64. Thanks a bunch
  65.  
  66. Melissa
  67. -- 
  68. Melissa A. Hines                   Melissa.Hines@Cornell.edu
  69. Dept. of Chemistry
  70. Cornell University
  71.  
  72. +++++++++++++++++++++++++++
  73.  
  74. >From phixus@deltanet.com (Chris De Salvo)
  75. Date: Sun, 08 Oct 1995 00:02:26 -0700
  76. Organization: MacPlay
  77.  
  78. In article <Melissa.Hines-0710950831170001@128.253.229.125>,
  79. Melissa.Hines@Cornell.edu (Melissa A. Hines) wrote:
  80.  
  81. > The subject says it all:
  82. > How do I get a hold of the color table for a given PICT? I need to change
  83. > it within my program.
  84.  
  85. What you're interested in is the call GetPictInfo().  You pass it a
  86. PicHandle, a PictInfo record, and some commands and it returns stuff to
  87. you.
  88.  
  89. You can have it return you a PaletteHandle or a CTabHandle for the PICTs colors.
  90.  
  91. Here is a basic usage to get back a CTabHandle:
  92.  
  93. PictInfo    thePictInfo
  94. PicHandle   thePict;
  95. OSErr       theErr;
  96. CTabHandle  myCLUT;
  97.  
  98.    //
  99.    //  Load the data for "thePict" here
  100.    //
  101.  
  102.    theErr = GetPictInfo(thePict, &thePictInfo, returnColorTable, 256
  103.                         popularMethod, 0);
  104.  
  105.    if (! theErr)
  106.       myCLUT = thePictInfo.theColorTable;
  107.  
  108. I'd suggest readng up on this call to see how all the arguments work. 
  109. There are three methods of sampling the colors:  systemMethod,
  110. popularMethod, medianMethod.  You'd need to see which one is best for your
  111. purposes.
  112.  
  113. L8R
  114. Chris
  115.  
  116. -- 
  117. +-----------------------------------------------------------------+
  118. | phixus@deltanet.com         |   Macintosh:  Changing the world, |
  119. | Chris De Salvo              |        one person at a time!      |
  120. | Professional Mac Geek       |    -----------------------------  |
  121. | for MacPlay, Inc.           |      (I wish they'd hurry up!)    |
  122. +-----------------------------------------------------------------+
  123.  
  124. Any opinions expressed, or implied, are my own!  They should not be
  125. considered representative of the opinions or policies of my employer,
  126. MacPlay, a division of Interplay Productions, Inc.
  127.  
  128. ---------------------------
  129.  
  130. >From mwhid@minnow.cis.ufl.edu (Michael C. Whidden)
  131. Subject: Apple Event: How to get Address of sender
  132. Date: 7 Oct 1995 17:48:58 GMT
  133. Organization: Univ. of Florida CIS Dept.
  134.  
  135. I'm experimenting with remote apple events.  I have been trying to
  136. figure out how to get the address of the App that sends me an event.
  137.  
  138. I tried getting it out of the keyAddressAttr of the reply Event, but
  139. it gives me an error about an unknown address type (-1716) when I 
  140. use AESend to that target address.
  141.  
  142. I thought about somehow writing my server to send the client its own
  143. addressdesc, but I have know idea how to find out what it is.
  144.  
  145. I know the Idle Proc when waiting for a reply gives you the addressdesc
  146. of the sender, but I don't want to write a idle proc.
  147.  
  148. Anybody have any ideas?
  149.  
  150. Thanks, 
  151. Mike
  152.  
  153. -- 
  154.     /\   /|                                  |  mwhid@cis.ufl.edu
  155.     | \ | |      \                           |  cirop34@grove.circa.ufl.edu
  156.    /  | | |  @   |  /                        |  hubris@ufcc.ufl.edu
  157.   /    \| |  \   |/      ___                 |And don't miss all the great  
  158.  
  159. +++++++++++++++++++++++++++
  160.  
  161. >From jonpugh@netcom.com (Jon Pugh)
  162. Date: Mon, 9 Oct 1995 20:14:29 GMT
  163. Organization: Will hack for food
  164.  
  165. Michael C. Whidden (mwhid@minnow.cis.ufl.edu) wrote:
  166. > I'm experimenting with remote apple events.  I have been trying to
  167. > figure out how to get the address of the App that sends me an event.
  168.  
  169. > I thought about somehow writing my server to send the client its own
  170. > addressdesc, but I have know idea how to find out what it is.
  171.  
  172. I would include a TargetID in the Apple event.  It's a specification
  173. of the machine, zone and port name.  It's pretty simple to create too.
  174. Using that, you can easily create an address desc to use.
  175.  
  176. Jon
  177.  
  178.  
  179. +++++++++++++++++++++++++++
  180.  
  181. >From eafunk@servtech.com (Ethan Funk)
  182. Date: Mon, 09 Oct 1995 17:45:14 -0400
  183. Organization: ServiceTech, Inc.
  184.  
  185. Michael C. Whidden (mwhid@minnow.cis.ufl.edu) wrote:
  186. > I'm experimenting with remote apple events.  I have been trying to
  187. > figure out how to get the address of the App that sends me an event.
  188.  
  189. > I thought about somehow writing my server to send the client its own
  190. > addressdesc, but I have know idea how to find out what it is.
  191.  
  192. Wow... For once I get to answer a question instead of ask! (Sorry, this is
  193. just very exciting for me.)
  194.  
  195. Here is what I did for a program I am writing that accepts apple events
  196. from a 'client'.  The client first sends a login apple event.  When my
  197. program receives this event, it extracts the address of the sender from
  198. the apple event and adds it to a list of addresses that it echos all other
  199. outgoing event to.  (It sounds weird, but it does the job for my
  200. application.
  201.  
  202. Here is the code (in C) for the procedure that handles the reception of
  203. the login event:
  204.  
  205. pascal OSErr DoAppLogIn(AppleEvent theAppleEvent, AppleEvent reply, long refCon)
  206. {
  207.    struct AddressList   *AddressPtr, *NewRec;
  208.    OSErr                err;
  209.    AppleEvent           temp;
  210.  
  211. // AppList is a global variable pointing to the list
  212. // "struct AddressList" is my structure for the address list records
  213.  
  214.    AddressPtr = AppList;   
  215.  
  216. // finds the last entry in the list
  217.  
  218.    while(AddressPtr->nextRec)
  219.       AddressPtr = AddressPtr->nextRec;  
  220.  
  221. // Create a new record to store the extracted address in my list
  222.  
  223.    if(NewRec = (struct  AddressList *)NewPtr(sizeof(struct AddressList))){
  224.  
  225. //  This is where I extract the address of the sender
  226.  
  227.       err = AEGetAttributeDesc(&reply, keyAddressAttr, typeWildCard,
  228.                                                           &(NewRec->address));
  229.  
  230. // This is where I store the extracted address in the new record and link
  231. it to // the end of the list.  Note: clientID is an ID number I send back
  232. to the 
  233. // client for a reference it be used in future transactions.
  234.  
  235.      if(err == noErr){
  236.          AddressPtr->nextRec = NewRec;
  237.          NewRec->clientID = AddressPtr->clientID + 1;
  238.          NewRec->prevRec = AddressPtr;
  239.          NewRec->nextRec = nil;
  240.  
  241.          err = AEPutParamPtr(&reply, 'clID', 'long', &NewRec->clientID,
  242.                                                                 sizeof(long));
  243. //  I send the client his clientID
  244.  
  245.          if(err == noErr)
  246.             err = AESend(&reply, &temp, kAENoReply + kAECanInteract,    
  247.                                               kAENormalPriority, 0, nil, nil);
  248.          AEDisposeDesc(&temp);
  249.          AEDisposeDesc(&reply);  
  250.          SendLists(&(NewRec->address));
  251.       }
  252.       else{
  253.          AEDisposeDesc(&(NewRec->address));
  254.          DisposePtr((void *)NewRec);
  255.       }
  256.    }  
  257. }
  258.  
  259. // The end!
  260.  
  261. I hope this helps.
  262.  
  263. Ethan...
  264.  
  265. ---------------------------
  266.  
  267. >From "Andrew C. Plotkin" <erkyrath+@CMU.EDU>
  268. Subject: Calling a PPC trap not in InterfaceLib
  269. Date: Wed,  4 Oct 1995 16:48:13 -0400
  270. Organization: Carnegie Mellon, Pittsburgh, PA
  271.  
  272. I have spent three and a half hours trying to figure out how to move
  273. the cursor around the screen. (YES, I tried to convince my boss it
  274. shouldn't be done. I lost.) 
  275.  
  276. This took an unbelievable amount of time. (Remember the first time you
  277. tried to find out how to implement TrapAvailable? That was 45 minutes
  278. by itself. I think I found it in a QuickTime tech note.) But that's
  279. not my question.
  280.  
  281. My question is, how do I link in the Cursor Device Manager calls? I'm
  282. #including <CursorDevices.h>, which defines inline assembly in 68K
  283. code, but when I try to compile the PPC version I get link errors --
  284. it can't find the functions.
  285.  
  286. This is under CodeWarrior 5.
  287.  
  288. My copy of NIM:PPC System Software is at home; Apple's web site won't
  289. give me its Acrobat version (even *after* I spend twenty minutes
  290. installing Acrobat off my develop 23 CD, which didn't have any useful
  291. information either); Metrowerks's web site doesn't seem to say how to
  292. do it... Oh, and I have to turn something in today, and if I'm home
  293. later than 8 I'll miss the DS9 premiere -- I mean, uh...
  294.  
  295. I *am* frustrated here. (Star Trek aside.)
  296.  
  297. --Z
  298.  
  299. "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
  300.  
  301. +++++++++++++++++++++++++++
  302.  
  303. >From colen@teleport.com (Colen Garoutte-Carson)
  304. Date: 5 Oct 1995 21:22:39 GMT
  305. Organization: Metrowerks Inc.
  306.  
  307. In article <UkQjAB_00WB3A9ZEsJ@andrew.cmu.edu>, "Andrew C. Plotkin"
  308. <erkyrath+@CMU.EDU> wrote:
  309.  
  310. > My question is, how do I link in the Cursor Device Manager calls? I'm
  311. > #including <CursorDevices.h>, which defines inline assembly in 68K
  312. > code, but when I try to compile the PPC version I get link errors --
  313. > it can't find the functions.
  314.  
  315. Andrew,
  316.  
  317.      My CursorDevices.h contains the following warning :
  318.  
  319. /*
  320.                       * * *  W A R N I N G  * * * 
  321.  
  322.    On currently shipping PowerMacs, the CursorDevices manager is implemented
  323.    in 68K code and emulated.  Unfortunately, the MixedMode glue in InterfaceLib
  324.    is incorrect.  It and the 1.0 version of this file had incorrect parameter
  325.    lists for most functions.
  326.    
  327.    As a first step to avoid runtime errors, the functions in this file were 
  328.    renamed (e.g. from"CrsrDevButtons" to "CursorDeviceButtons").  This
  329. will result
  330.    in a link time error if a PowerPC application tries to call the functions.
  331.    When InterfaceLib is fixed, the new names will be exported and PowerPC
  332.    code will then be able to call them.
  333.    
  334. */
  335.  
  336.      I believe this means that Apple is aware of the problem, as has yet
  337. to fix it...
  338.      What you could do is; create a 68K routine that calls the
  339. CursorDevices.h routine you want.  Disassemble that routine, and save the
  340. 68K hex code.  At runtime, in your PPC program, allocate a pointer and
  341. store the 68K hex code in it.  Use CallUniversalProc to jump to the data. 
  342. Since it's 68K code, it should not require a routine descriptor.  There
  343. are probably other purmutations of this approach that would work.  And,
  344. since the CursorDevices manager is implemented in 68K code and emulated,
  345. you should not lose any speed.
  346.  
  347.  - Colen Garoutte-Carson, Metrowerks Inc.
  348.  
  349. +++++++++++++++++++++++++++
  350.  
  351. >From ari@shore.net (Ari Halberstadt)
  352. Date: Fri, 06 Oct 1995 08:11:47 -0400
  353. Organization: North Shore Access/Eco Software, Inc; (info@shore.net)
  354.  
  355. In article <UkQjAB_00WB3A9ZEsJ@andrew.cmu.edu>, "Andrew C. Plotkin"
  356. <erkyrath+@CMU.EDU> wrote:
  357.  
  358. >I have spent three and a half hours trying to figure out how to move
  359. >the cursor around the screen. (YES, I tried to convince my boss it
  360. >shouldn't be done. I lost.) 
  361.  
  362. Ahem, Andy, most of us just push the mouse around. When we do, our bosses
  363. smile because they think we're working. :-)
  364.  
  365. >
  366. >This took an unbelievable amount of time. (Remember the first time you
  367. >tried to find out how to implement TrapAvailable? That was 45 minutes
  368. >by itself. I think I found it in a QuickTime tech note.) But that's
  369. >not my question.
  370. >
  371. >My question is, how do I link in the Cursor Device Manager calls? I'm
  372. >#including <CursorDevices.h>, which defines inline assembly in 68K
  373. >code, but when I try to compile the PPC version I get link errors --
  374. >it can't find the functions.
  375.  
  376. I don't know squat about the CDM, but assume that there is no PPC glue in
  377. existence. You need to compile the routines as 68K code with Mixed Mode
  378. muck around them. I *think* something like the following tortuous mess
  379. will do.
  380.  
  381. Use a selector-based switch statement accessed via
  382. GlueSomeAppleFooWithASwitch with a union being used to pass parameters in
  383. a single block which is then broken back into individual params. Something
  384. hideous like
  385.  
  386. int SomeAppleFoo(foo, stuff) = { 0x1234, 0x5678 }; // a CDM thing
  387.  
  388. void GlueSomeAppleFooWithASwitch(AppleFooGlueSelector selector,
  389. AppleFooGlueParamBlock *params)
  390. {
  391.    switch (selector) {
  392.    case kSomeAppleFoo:
  393.        params->SomeAppleFoo.result =
  394. SomeAppleFoo(params->SomeAppleFoo.foo, params->SomeAppleFoo.stuff);
  395.       break;
  396.    case kSomeOtherAppleFoo:
  397.       SomeOtherAppleFoo(params->SomeOtherAppleFoo.foo,
  398. params->SomeOtherAppleFoo.foo);
  399.       break;
  400.    default:
  401.       DebugStr("\pThis Foo does not belong in Cupertino.");
  402.    }
  403. }
  404.  
  405. Compile the above as 68K code and stick it in a resource of some arbitrary
  406. type.  Then, to call it, use something even more hideous:
  407.  
  408. int PPCSomeAppleFoo(foo, stuff)
  409. {
  410.    AppleFooGlueParamBlock params;
  411.  
  412.   glueH = GetResource('GAPF', rGlueAppleFoo);
  413.   glueState = HGetState(glueH);
  414.   HLock(glueH);
  415.   entryPoint = (GlueSomeAppleFooWithASwitchPtr) *glueH;
  416.   params.SomeAppleFoo.foo = foo;
  417.   params.SomeAppleFoo.stuff = stuff;
  418.   CallUniversalProc(entryPoint, GlueSomeAppleFooWithASwitchProcInfo,
  419.     kSomeAppleFoo, ¶ms);
  420.   HSetState(glueH,glueState);
  421.   return params.SomeAppleFoo.result;
  422. }
  423.  
  424. You need to invent a procInfo thing for GlueSomeAppleFooWithASwitch, using
  425. the magic constants in MixedMode.h.
  426.  
  427. I think the Component Manager might handle some of this muck for you.
  428.  
  429. The above solution is so ugly, there must be a better way.
  430.  
  431. >do it... Oh, and I have to turn something in today, and if I'm home
  432. >later than 8 I'll miss the DS9 premiere -- I mean, uh...
  433.  
  434. Hey, we have to wait till Saturday! No spoilers, please.
  435.  
  436. -- Ari Halberstadt (ari@shore.net, ari@world.std.com)
  437. For latest versions of some of my Macintosh software try <ftp://ftp.shore.net/members/ari>.
  438.  
  439. +++++++++++++++++++++++++++
  440.  
  441. >From brians@pbcomputing.com (Brian Stern)
  442. Date: 6 Oct 1995 13:14:52 GMT
  443. Organization: The University of Texas at Austin, Austin, Texas
  444.  
  445. In article <UkQjAB_00WB3A9ZEsJ@andrew.cmu.edu>, "Andrew C. Plotkin"
  446. <erkyrath+@CMU.EDU> wrote:
  447.  
  448. <I have spent three and a half hours trying to figure out how to move
  449. <the cursor around the screen. (YES, I tried to convince my boss it
  450. <shouldn't be done. I lost.) 
  451. <
  452. <This took an unbelievable amount of time. (Remember the first time you
  453. <tried to find out how to implement TrapAvailable? That was 45 minutes
  454. <by itself. I think I found it in a QuickTime tech note.) But that's
  455. <not my question.
  456. <
  457. <My question is, how do I link in the Cursor Device Manager calls? I'm
  458. <#including <CursorDevices.h>, which defines inline assembly in 68K
  459. <code, but when I try to compile the PPC version I get link errors --
  460. <it can't find the functions.
  461. <
  462. <This is under CodeWarrior 5.
  463. <
  464. <My copy of NIM:PPC System Software is at home; Apple's web site won't
  465. <give me its Acrobat version (even *after* I spend twenty minutes
  466. <installing Acrobat off my develop 23 CD, which didn't have any useful
  467. <information either); Metrowerks's web site doesn't seem to say how to
  468. <do it... Oh, and I have to turn something in today, and if I'm home
  469. <later than 8 I'll miss the DS9 premiere -- I mean, uh...
  470. <
  471. <I *am* frustrated here. (Star Trek aside.)
  472. <
  473. <--Z
  474. <
  475. <"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
  476.  
  477. I don't know anything about the cursor control manager but you can call
  478. 68K code using CallUniversalProc.  There is an example on the CD called
  479. SwitchBank that shows how to call the ServerDispatch trap in this way.  
  480.  
  481. The basic strategy is to build a static array that holds the 68K opcodes
  482. (with an rts at the end).  Build the appropriate procinfo.  Pass
  483. CallUniversalProc the address of the static array and the procinfo and
  484. you're all set.  This should all go in a header file with appropriate
  485. ifdefs so that it works the same in 68K code as in PPC code.
  486.  
  487. It's a bit goofy but it works.
  488.  
  489. ____________________________________________________________________
  490. Brian  Stern  {;-{)}                  Toolbox commando and Menu bard                  Stern@metrowerks.com                          BrianS@pbcomputing.com
  491. INIT Writing FAQ etc. at <ftp://ftp.pbcomputing.com//Guests/BrianS/>
  492.  
  493. +++++++++++++++++++++++++++
  494.  
  495. >From "Andrew C. Plotkin" <erkyrath+@CMU.EDU>
  496. Date: Fri,  6 Oct 1995 11:36:22 -0400
  497. Organization: Carnegie Mellon, Pittsburgh, PA
  498.  
  499. Various people have given me various workable answers. Thanks all. The
  500. nicest one actually mailed me a newer copy of InterfaceLib, so I
  501. should be able to get something to work.
  502.  
  503. --Z
  504.  
  505. "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
  506.  
  507. +++++++++++++++++++++++++++
  508.  
  509. >From allender@prairienet.org (Mark W. Allender)
  510. Date: 10 Oct 1995 16:38:08 GMT
  511. Organization: Prairienet, the East-Central Illinois Free-Net
  512.  
  513. Colen Garoutte-Carson (colen@teleport.com) wrote:
  514. : /*
  515. :                       * * *  W A R N I N G  * * * 
  516.  
  517. :    On currently shipping PowerMacs, the CursorDevices manager is implemented
  518. :    in 68K code and emulated.  Unfortunately, the MixedMode glue in InterfaceLib
  519. :    is incorrect.  It and the 1.0 version of this file had incorrect parameter
  520. :    lists for most functions.
  521. :    
  522. :    As a first step to avoid runtime errors, the functions in this file were 
  523. :    renamed (e.g. from"CrsrDevButtons" to "CursorDeviceButtons").  This
  524. : will result
  525. :    in a link time error if a PowerPC application tries to call the functions.
  526. :    When InterfaceLib is fixed, the new names will be exported and PowerPC
  527. :    code will then be able to call them.
  528. :    
  529. : */
  530.  
  531. InterfaceLib that shipped with CW6 (and some version of MPW that I can't track
  532. down right now) had the new routine names defined.  Thery werer subsequently
  533. gome in CW7 (due to a problem with apple I heard....).  I've been using
  534. CDM calls in my application without any link error (assuming that I use the
  535. appropriate interfaceLib).
  536.  
  537. --
  538. -Mark Allender
  539. -Parallax Software
  540. -allender@il.pxsoftware.com
  541.  
  542. ---------------------------
  543.  
  544. >From Jeremy@vms.huji.ac.il (Jeremy Moskovich)
  545. Subject: Custom Palettes with GWorld & Picts...
  546. Date: Sun, 08 Oct 1995 00:01:44 +0200
  547. Organization: (none)
  548.  
  549. hi,
  550.     I'm trying to set up a custom color palette for an image I want to display.
  551.   Heres what I've arrived at so far:
  552. a)Create a GWorld
  553. b)Create a new palette with NewPalette() derived from 'clut' id. 8, with
  554. 256 entries, pmTollerant, & the tollerance set to 0x0000.
  555. c)Add all the colors I want to the new palette with SetEntryColor().
  556. d)Assign the palette to the Gworld with NSetPalette().
  557. e)Do some drawing in the GWorld.
  558. f)Create a new Cwindow.
  559. g)Assign the same palette to the CWindow (again with NSetPalette()).
  560. h)set the ctSeed of the Window and the GWorld to equal one another.
  561. i)Copybits the image from the Gworld to the CWindow.
  562.  
  563.    Is this correct?  Am I missing some fundamental step?
  564.  
  565.    On a different note, does anyone know how to create a PICT with a
  566. custom color table?  Is the current color table automatically used when I
  567. call OpenCPicture()?
  568.  
  569. Thanks in advance,
  570. Jeremy
  571. P.S. Please CC me any replies to this post if possible since my news
  572. server isn't very reliable.
  573.  
  574. *-=-=-=-=-=-=-=-=-=-= Jeremy Moskovich | Jeremy@vms.huji.ac.il =-=-=-=-=-=-=-=-*
  575. + -=-=-=-   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   -=-=-=- +
  576. |        If it moves eat it, if it doesn’t move eat it anyway! - pacman        |
  577. |     Penn&Teller, The PRODIGY, SoundGarden, RC, C, 1984, Baking, StarTrek     |
  578. *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
  579.  
  580. +++++++++++++++++++++++++++
  581.  
  582. >From tim@dierks.org (Tim Dierks)
  583. Date: Sat, 07 Oct 1995 18:56:02 -0700
  584. Organization: Best Internet Communications
  585.  
  586. In article <Jeremy-0810950001440001@jeremy.slip.huji.ac.il>, Jeremy@vms.huji.ac.il (Jeremy Moskovich) wrote:
  587. >    I'm trying to set up a custom color palette for an image I want to display.
  588. >  Heres what I've arrived at so far:
  589. >a)Create a GWorld
  590. >b)Create a new palette with NewPalette() derived from 'clut' id. 8, with
  591. >256 entries, pmTollerant, & the tollerance set to 0x0000.
  592. > [ c-i omitted ]
  593.  
  594. The Palette Manager doesn't work (or at least, not very well), with
  595. GWorlds. What you want to do is make sure you GWorld has the right colors, your
  596. window has the right colors, and then let CopyBits do the work of converting
  597. between the actual indices. Thus, set up a clut handle and pass it to
  598. NewGWorld. This will ensure you've got the right colors available
  599. off-screen. Make your clut into a palette and apply it to your window. This
  600. will ensure you've got the right colors on-screen. CopyBits away.
  601.  
  602. If you're looking for the speed of having the color tables match, index for
  603. index, you need to do the palette first, make sure your window is active, then
  604. steal the clut from the GDevice you wish to match (which is probably the one
  605. which matches the offscreen in depth, etc., and which most of the window in
  606. question is on) and use it when creating the GWorld. Alternately, just use the
  607. noNewDevice flag and pass the global rectangle of your window. However, if
  608. ultra-speed isn't needed, the first method is preferred (it's cleaner).
  609.  
  610. >   On a different note, does anyone know how to create a PICT with a
  611. >custom color table?  Is the current color table automatically used when I
  612. >call OpenCPicture()?
  613.  
  614. No; when you do a CopyBits(), the color table of the source is stored with the
  615. pixels. This will be used when playing the picture back. Thus, if you've got an
  616. offscreen, SetGWorld() to it, OpenCPicture() then CopyBits() the image on top
  617. of itself; ClosePicture() and voila! Serves 4.
  618.  
  619.  - Tim
  620.  
  621. -- 
  622. Tim Dierks - Software Haruspex - tim@dierks.org
  623. If you can't lick 'em, stick 'em on with a big piece of tape. - Negativland
  624.  
  625. +++++++++++++++++++++++++++
  626.  
  627. >From Jeremy@vms.huji.ac.il (Jeremy Moskovich)
  628. Date: Mon, 09 Oct 1995 02:15:26 +0200
  629. Organization: (none)
  630.  
  631. >What you want to do is make sure you GWorld has the right colors, your window 
  632. >has the right colors, and then let CopyBits do the work of converting between 
  633. >the actual indices. Thus, set up a clut handle and pass it to NewGWorld. This 
  634. >will ensure you've got the right colors available off-screen. Make your clut 
  635. >into a palette and apply it to your window. This will ensure you've got the 
  636. >right colors on-screen. CopyBits away.
  637.  
  638.     How do I set individual entries in a color table?  Apart from the
  639. ctSize field, think ref. doesn't say much about what the fields in a
  640. ColorTable do...
  641.     Can I just create a new palette, set up the entries with
  642. SetEntryColor() and then call Palette2CTab() to get my ColorTable to apply
  643. in NewGWorld()?
  644.  
  645. >If you're looking for the speed of having the color tables match, index for 
  646. >index, you need to do the palette first, make sure your window is active, then 
  647. >steal the clut from the GDevice you wish to match (which is probably the one 
  648. >which matches the offscreen in depth, etc., and which most of the window in 
  649. you mean doing something like?:
  650.     SetGWorld( CWind, targetGDHand );
  651.     Err = NewGWorld( MyGWorldPtr, 8, Cwind->port.portRect,
  652.                      Cwind->port.(**(portPixMap)).pmTable, //the Window's CLUT?
  653.                      0,0); 
  654.  
  655. >question is on) and use it when creating the GWorld. Alternately, just use the 
  656. >noNewDevice flag and pass the global rectangle of your window. However, if 
  657.  
  658. you mean?:
  659.    GlobalRect = MyRectLocal2Global( Cwind->port.portRect );
  660.    Err = NewGWorld( MyGWorldPtr, 8, GlobalRect, 0, 0, noNewDevice );
  661.  
  662. Thanks!,
  663. Jeremy
  664.  
  665. *-=-=-=-=-=-=-=-=-=-= Jeremy Moskovich | Jeremy@vms.huji.ac.il =-=-=-=-=-=-=-=-*
  666. + -=-=-=-   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   -=-=-=- +
  667. |        If it moves eat it, if it doesn’t move eat it anyway! - pacman        |
  668. |     Penn&Teller, The PRODIGY, SoundGarden, RC, C, 1984, Baking, StarTrek     |
  669. *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
  670.  
  671. +++++++++++++++++++++++++++
  672.  
  673. >From asouthwick@vnet.ibm.com (Andrew Southwick)
  674. Date: 10 Oct 1995 18:59:00 GMT
  675. Organization: IBM SWSD, Performance Tools, LEX
  676.  
  677. Jeremy@vms.huji.ac.il (Jeremy Moskovich) writes:
  678. >    I'm trying to set up a custom color palette for an image I want to display.
  679. >  Heres what I've arrived at so far:
  680.  
  681. Rearrange the order you do things in this way:
  682.  a) create a 'clut' resource with all of the entries you want using ResEdit
  683.  b) load in the 'clut' into memory
  684.  c) change entries in the clut if you want to
  685.  d) Create a GWorld, and specify this color table as the one you want to use
  686.  e) draw in the GWorld
  687.  f) create a CWindow
  688.  g) convert the clut into a palette
  689.  h) NSetPalette( myCWindow, myNewPalette )
  690.  i) do the ctSeed slam
  691.  j) CopyBits
  692.  
  693. >   On a different note, does anyone know how to create a PICT with a
  694. >custom color table?  Is the current color table automatically used when I
  695. >call OpenCPicture()?
  696.  
  697. A color table is saved with a PICT resource.  A new color table will be
  698. created when you close the picture, containing an entry for each different
  699. RGB color you drew with while the picture was open.  If you are drawing to
  700. the screen, then only entries in the color table used by that monitor will
  701. be used (although, if you use only a subset of all of the entries in that
  702. color table, only those *actually used* will be in the color table saved
  703. with the PICT).  Likewise for GWorlds.  Whatever it looks like on the screen,
  704. the PICT will save the exact RGB colors.
  705.  
  706. >*-=-=-=-=-=-=-=-=-=-= Jeremy Moskovich | Jeremy@vms.huji.ac.il =-=-=-=-=-=-=-=-*
  707.  
  708.  
  709. Andrew R Southwick          -={C++/OO Programmer}=-     asouthwick@vnet.ibm.com
  710. #include "disclaimer.std"                                  I speak not for IBM.
  711.             -= Freedom by permission is a contradiction in terms =-
  712.  
  713.  
  714. ---------------------------
  715.  
  716. >From macjack@ids.net
  717. Subject: Pixel data -> GWorld possible?
  718. Date: Thu,  5 Oct 95 19:11:07 +500
  719. Organization: IDS World Network Internet Access Service, (800)IDS-1680
  720.  
  721. Hello all.
  722.  
  723. I have written a program the reads a raw image data file into memory and
  724. displays it in a window on the screen by way of multiple calls to
  725. SetCPixel(). To avoid the "scanning display" effect that occurs when an image
  726. is drawn one pixel at a time (I find it appealing, but my customer does not),
  727. I am drawing into an offscreen GWorld and then CopyBits()ing the resultant
  728. image onto the screen.
  729.  
  730. However this method seems a bit redundant: the data is already in memory, so
  731. why shouldn't I be able to just BlockMove() it into the GWorld's pixMap
  732. instead of doing it pixel by pixel? I tried doing just this, using
  733. BlockMove() to transfer the pixel data from the image's pointer to the
  734. baseAddr of the GWorld's pixMap. Apparently I didn't know what I was doing,
  735. because I was confronted with a nasty bus error. Still it seems like this
  736. _should be_ possible somehow.
  737.  
  738. Anyone know the solution? Any help would be greatly appreciated! Thanks!
  739. --
  740. Louis Deaett      | "It's not how powerful the computer is, it's how
  741. <macjack@ids.net> | much more powerful it is than those of your peers."
  742.  
  743. +++++++++++++++++++++++++++
  744.  
  745. >From tulip@tiac.net (Ed Anson)
  746. Date: Fri, 06 Oct 1995 00:19:20 -0400
  747. Organization: Tulip Software
  748.  
  749. In article <451oob$8t5@paperboy.ids.net>, macjack@ids.net wrote:
  750.  
  751. > I have written a program the reads a raw image data file into memory and
  752. > displays it in a window on the screen by way of multiple calls to
  753. > SetCPixel(). To avoid the "scanning display" effect that occurs when an image
  754. > is drawn one pixel at a time (I find it appealing, but my customer does not),
  755. > I am drawing into an offscreen GWorld and then CopyBits()ing the resultant
  756. > image onto the screen.
  757. > However this method seems a bit redundant: the data is already in memory, so
  758. > why shouldn't I be able to just BlockMove() it into the GWorld's pixMap
  759. > instead of doing it pixel by pixel? I tried doing just this, using
  760. > BlockMove() to transfer the pixel data from the image's pointer to the
  761. > baseAddr of the GWorld's pixMap. Apparently I didn't know what I was doing,
  762. > because I was confronted with a nasty bus error. Still it seems like this
  763. > _should be_ possible somehow.
  764.  
  765. Since you already have the pixel data in memory, the GWorld is indeed
  766. redundant. Generally, it is useful for creating offscreen pixmaps.
  767.  
  768. You can create your own PixMap and set it up to reference the pixel
  769. buffer. Then you just blast it to the screen with CopyBits. The info in
  770. Inside Mac is sufficient to guide you through the process. I also wouldn't
  771. be surprised if there is half a ton of sample code on the Developer CD.
  772.  
  773. As for your bus error: I'm not really sure what happened to you. However,
  774. it's not considered cool to write directly to the GWorld buffer. In some
  775. implementations, it doesn't really exist in your address space. Although
  776. you can force it to be in accessible memory, that's another subject and
  777. you don't need to worry about that today.
  778.  
  779. - --------------------
  780. Ed Anson            MediaTree: multimedia outline editor & catalog
  781. Tulip Software
  782. Andover, MA 01810   For details, check out my WWW page:
  783. U.S.A.              <http://www.tiac.net/users/tulip/home.html>
  784.  
  785. +++++++++++++++++++++++++++
  786.  
  787. >From dichiapp@tiac.net (Mike DiChiappari)
  788. Date: Mon, 09 Oct 1995 22:18:34 -0500
  789. Organization: The Internet Access Company
  790.  
  791. In article <451oob$8t5@paperboy.ids.net>, macjack@ids.net wrote:
  792.  
  793. > I have written a program the reads a raw image data file into memory and
  794. > displays it in a window on the screen by way of multiple calls to
  795. > SetCPixel(). To avoid the "scanning display" effect that occurs when an image
  796. > is drawn one pixel at a time (I find it appealing, but my customer does not),
  797. > I am drawing into an offscreen GWorld and then CopyBits()ing the resultant
  798. > image onto the screen.
  799. > However this method seems a bit redundant: the data is already in memory, so
  800. > why shouldn't I be able to just BlockMove() it into the GWorld's pixMap
  801. > instead of doing it pixel by pixel? I tried doing just this, using
  802. > BlockMove() to transfer the pixel data from the image's pointer to the
  803. > baseAddr of the GWorld's pixMap. Apparently I didn't know what I was doing,
  804. > because I was confronted with a nasty bus error. Still it seems like this
  805. > _should be_ possible somehow.
  806.  
  807. Louis,
  808.  
  809. First, you don't need the memory buffer.  Just read the image file into
  810. the offscreen GWorld.  You must place the data in the offscreen GWorld's
  811. PixMap in the correct format (32 bit, 16 bit, etc…).  You need to do the
  812. following:
  813.  
  814. 1) Create an offscreen NewGWorld() of the appropriate pixel depth and
  815. size.  If you are using color lookup tables, then you will have to set one
  816. of these up too.
  817.  
  818. 2) Lock that new GWorld PixMap's baseAddr.  The baseAddr is the start of
  819. the image data and it must be locked, because it may be a handle.  To lock
  820. it use LockPixels().  NOTE: This is probably why your call to BlockMove()
  821. failed.
  822.  
  823. 3) After you lock the pixels you can get the baseAddr by calling
  824. GetPixBaseAddress().
  825.  
  826. 4) Before accessing the baseAddr you may want to call SwapMMUMode() if you
  827. want you application to work when 32 bit addressing isn't turned on.
  828.  
  829. 5) Now you can write the the PixMap's baseAddr.  Don't go past the end of
  830. it, though.  Make sure you format the data properly given the PixMap's
  831. pixelType, pixelSize, cmpCount, and cmpSize.  In other words, format the
  832. image data appropriately.
  833.  
  834. 6) When you are finished, call UnlockPixels().
  835.  
  836. Mike
  837.  
  838. ---------------------------
  839.  
  840. >From Jefferson Provost <provost+@CMU.EDU>
  841. Subject: Sound Timing Question
  842. Date: Mon,  9 Oct 1995 14:28:48 -0400
  843. Organization: Psychology, Carnegie Mellon, Pittsburgh, PA
  844.  
  845.  
  846. Hi,
  847.  
  848. I have an application which I need to play sampled sounds with very
  849. tight control over the timing.  In particular, I need:
  850.  
  851. a) The Sound Manager to play a sound as quickly as possible after the
  852. application asks for it to be played
  853.  
  854. b) To know as closely as possible when a sound actually started playing.
  855.  
  856.  
  857. I had hacked up a method which worked fairly well before Sound Manager
  858. 3.0, but that I've just discovered doesn't work well at all with SM 3.0
  859. or later.
  860.  
  861. What I do is create a SndDoubleBufferHeader struct that points to two
  862. buffers.  The first buffer is empty, and has 0 samples.  The second
  863. buffer contains the sound I want to play.  Then when I call
  864. SndPlayDoubleBuffer, my DoubleBackProc is called immediately, at which
  865. point I save the time and call it the starting time of the sound.
  866.  
  867. This worked fine before SM 3.0.  I tested it by hooking up the speaker
  868. out to an external voice key, which then ran back to my app via the
  869. serial port.  Using this method I could see that the sound was
  870. _actually_ starting around 2ms after my DoubleBackProc was being called.
  871.  
  872. Now, however, with SM 3.0 (or 3.1), it can take anywhere from 50 to 100
  873. msec for my sound to start _after_ my DoubleBackProc is called.  (50ms
  874. on a IIci, and anywhere from 60 to 100ms on a 7100/66 running emulated
  875. code with speed doubler)
  876.  
  877. What's taking it so long?  And does anyone know what I can do to fix it?
  878.  I find it kind of ironic that the Tech Notes and Develop article on the
  879. changes for SM 3.0 brag about how much faster and more efficient SM 3.0
  880. is, yet in the one area in which I need to it be efficient, it's
  881. actually much slower.
  882.  
  883. Any help, anyone?
  884.  
  885. J.
  886.  
  887.  
  888.  
  889. +++++++++++++++++++++++++++
  890.  
  891. >From Hubert Voogd <voogd@psych.kun.nl>
  892. Date: 10 Oct 1995 11:03:51 GMT
  893. Organization: E.R.G. department of Psychology, KU Nijmegen
  894.  
  895. Jefferson Provost <provost+@CMU.EDU> wrote:
  896. >
  897. >Hi,
  898. >
  899. >I have an application which I need to play sampled sounds with very
  900. >tight control over the timing.  In particular, I need:
  901. >
  902. >a) The Sound Manager to play a sound as quickly as possible after the
  903. >application asks for it to be played
  904. >
  905. >b) To know as closely as possible when a sound actually started playing.
  906. >
  907. [Hacked method snipped..]
  908. >
  909. >This worked fine before SM 3.0.  I tested it by hooking up the speaker
  910. >out to an external voice key, which then ran back to my app via the
  911. >serial port.  Using this method I could see that the sound was
  912. >_actually_ starting around 2ms after my DoubleBackProc was being called.
  913.  
  914. Yep, but this is a solution to b), it still has the problems to a)
  915.  
  916. >
  917. >Now, however, with SM 3.0 (or 3.1), it can take anywhere from 50 to 100
  918. >msec for my sound to start _after_ my DoubleBackProc is called.  (50ms
  919. >on a IIci, and anywhere from 60 to 100ms on a 7100/66 running emulated
  920. >code with speed doubler)
  921. >
  922. >What's taking it so long?  And does anyone know what I can do to fix it?
  923. > I find it kind of ironic that the Tech Notes and Develop article on the
  924. >changes for SM 3.0 brag about how much faster and more efficient SM 3.0
  925. >is, yet in the one area in which I need to it be efficient, it's
  926. >actually much slower.
  927.  
  928. Nope, you are fooled. The DoubleBackProc _had_ a delay, but now, it
  929. doesn't have that delay anymore. Look at the delay of the DoubleBackProc
  930. in older SoundManagers.
  931.  
  932. >Any help, anyone?
  933. >
  934. >J.
  935.  
  936. As a developer of C_Frame, I discovered this problem about 4 months ago,
  937. by using a scope to look at the sound, triggering at the moment I wanted
  938. a sound to play.
  939. MacIntosh seems to put sound samples in the video buffer (much like
  940. the Amiga uses a Copper list). Every 4th vertical blank, a sound can
  941. appear from the speakers (causing a delay of max 4*17 ms). You have to 
  942. synchronise to that vertical blank.
  943. Your DoubleBackProc had a delay before SoundManager 3.0 which was more
  944. or less the equal to the delay the sound had. This way, you had a 
  945. solution to b). In SoundManager 3.0, the DoubleBackProc is called
  946. without a delay, thus disabling the solution to b). There is no solution
  947. to a), but to my experimentors, it is not important to control the
  948. moment a sound is playing. It is more important to know that moment.
  949.   I solved the problem in two different ways: 1) using a soundkey, to 
  950. measure the moment the sound starts playing. 2) Correcting data by
  951. predicting that moment. The problem in 2) is that you have to know
  952. the moment the first sound appears from the speakers, but you can
  953. make a lot of guesses and then choose the correct guess.
  954.  
  955. If you need more information, e-mail me, or look at the C_Frame site:
  956. http://kunpwe.psych.kun.nl/~voogd/C_Frame.html
  957.  
  958. Greetings, Hubert
  959.  
  960.  
  961.  
  962.  
  963.  
  964. ---------------------------
  965.  
  966. >From st91cztr@dunx1.ocs.drexel.edu (Duncan Widman)
  967. Subject: What is the most current electronic reference?
  968. Date: 5 Oct 1995 12:59:56 GMT
  969. Organization: Drexel University, Philadelphia
  970.  
  971. I was wondering what is the most recent electronic reference for mac 
  972. toolbox calls. I have been using Think Ref, which I like a lot and 
  973. consider invaluable, but is version 2.01 and copyright 1992, so it only 
  974. contains IM up to the old vol IV. This is fine so far, but if I ever need 
  975. more up-to-date info, does Symantic have an upgrade plan, or is apple's 
  976. CD-rom version of IM better (not that I even have a CD-rom drive), or 
  977. does someone else (CodeWarrior?) make a better reference?
  978.  
  979. thanks bunches,
  980. Duncan
  981.  
  982. -- 
  983. ______________________________________________________________________________
  984. Duncan Widman  EE Class of 96           
  985. Drexel University                     
  986. st91cztr@dunx1.ocs.drexel.edu
  987.  
  988. +++++++++++++++++++++++++++
  989.  
  990. >From pjvoogt@euronet.nl (Paul J. Voogt)
  991. Date: Fri, 06 Oct 1995 18:36:08 +0100
  992. Organization: Euronet
  993.  
  994. In article <450ksc$l9f@noc2.drexel.edu>,
  995. st91cztr@dunx1.ocs.drexel.edu (Duncan Widman) wrote:
  996.  
  997. >I was wondering what is the most recent electronic reference for mac 
  998. >toolbox calls. I have been using Think Ref, which I like a lot and 
  999. >consider invaluable, but is version 2.01 and copyright 1992, so it only 
  1000. >contains IM up to the old vol IV. This is fine so far, but if I ever need 
  1001. >more up-to-date info, does Symantic have an upgrade plan, or is apple's 
  1002. >CD-rom version of IM better (not that I even have a CD-rom drive), or 
  1003. >does someone else (CodeWarrior?) make a better reference?
  1004.  
  1005. The latest version of Think Reference is 2.0.3 (although the databases
  1006. haven't been updated since 1992, Symantec did, however, include a new
  1007. database about TCL 2.0 in their latest release of C++ for Macintosh).
  1008. Symantec has no plans to update the product to the New Inside Macintosh
  1009. series.
  1010.  
  1011. There is an new electronic reference that is supported by Apple (they post
  1012. new databases regularly on their FTP sites). I's called "Macintosh
  1013. Programmer's Toolbox Assistant" and is published by Addison-Wesley on
  1014. CD-ROM (ISBN 0-210-96642-5) and costs about U$ 99,-. Although both are
  1015. hypertext-based I preferred the Think Ref interface over MPTA, but at least
  1016. MPTA is up to date and kept that way by Apple. BTW, Apple's CD-ROM version
  1017. of IM is very much worth while, and contains the same information as the
  1018. MPTA CD-ROM, but in a different format (DocViewer documents vs QuickView
  1019. databases). I guess you'll have to buy a CD-ROM...
  1020.  
  1021.  
  1022.  
  1023. --
  1024. Paul J. Voogt                                                  <pjvoogt@euronet.nl>
  1025. - ----------------------------------------------------
  1026.  
  1027. +++++++++++++++++++++++++++
  1028.  
  1029. >From Ericb@psu.edu (emb121 (Eric Bennett))
  1030. Date: 6 Oct 1995 23:37:43 GMT
  1031. Organization: Penn State University, Center for Academic Computing
  1032.  
  1033. In article <AC9B279896687CE27@p015.ztm.euronet.nl>
  1034. pjvoogt@euronet.nl (Paul J. Voogt) writes:
  1035.  
  1036. > BTW, Apple's CD-ROM version
  1037. > of IM is very much worth while, and contains the same information as the
  1038. > MPTA CD-ROM, but in a different format (DocViewer documents vs QuickView
  1039. > databases). I guess you'll have to buy a CD-ROM...
  1040.  
  1041. Just remember that if you have the storage space, you can get most of
  1042. the core Inside Mac volumes from ftp.support.apple.com (the files are
  1043. in Adobe Acrobat PDF format).
  1044.  
  1045. -Eric Bennett (ericb@psu.edu)
  1046.  
  1047. Drawing on my fine command of the language, I said nothing.
  1048. -Robert Benchley
  1049.  
  1050. +++++++++++++++++++++++++++
  1051.  
  1052. >From jordanz@altura.com (Jordan Zimmerman)
  1053. Date: Fri, 06 Oct 1995 16:56:54 -0800
  1054. Organization: Altura Software, Inc.
  1055.  
  1056. > I was wondering what is the most recent electronic reference for mac 
  1057. > toolbox calls. I have been using Think Ref, which I like a lot and 
  1058. > consider invaluable, but is version 2.01 and copyright 1992, so it only 
  1059. > contains IM up to the old vol IV. This is fine so far, but if I ever need 
  1060. > more up-to-date info, does Symantic have an upgrade plan, or is apple's 
  1061. > CD-rom version of IM better (not that I even have a CD-rom drive), or 
  1062. > does someone else (CodeWarrior?) make a better reference?
  1063.  
  1064. The most current online reference would be Apple's Macintosh Programmer's
  1065. Toolbox Assistant (MPTA). Check out:
  1066.      http://www.info.apple.com/dev/MPTA.html
  1067.  
  1068. -- 
  1069. Jordan Zimmerman, Altura Software
  1070. home page: http://www.altura.com/jordanz/home.html
  1071. Coming to you fast as lightning on a 9500/120!
  1072.  
  1073. +++++++++++++++++++++++++++
  1074.  
  1075. >From Ericb@psu.edu (emb121 (Eric Bennett))
  1076. Date: 9 Oct 1995 18:17:49 GMT
  1077. Organization: Penn State University, Center for Academic Computing
  1078.  
  1079. In article <454ek7$k2c@hearst.cac.psu.edu>
  1080. Ericb@psu.edu (emb121 (Eric Bennett)) writes:
  1081.  
  1082. > Just remember that if you have the storage space, you can get most of
  1083. > the core Inside Mac volumes from ftp.support.apple.com (the files are
  1084. > in Adobe Acrobat PDF format).
  1085.  
  1086. Oops... that should be ftp.info.apple.com, specifically:
  1087.  
  1088. ftp://ftp.info.apple.com/Apple.Support.Area/Developer_Services/Technical
  1089. _Documentation/Inside_Macintosh/
  1090.  
  1091. Somebody emailed be about whether the files are on ftp.support--which
  1092. they're not--but the return address was not valid :(
  1093.  
  1094. -Eric Bennett (ericb@psu.edu)
  1095.  
  1096. Drawing on my fine command of the language, I said nothing.
  1097. -Robert Benchley
  1098.  
  1099. ---------------------------
  1100.  
  1101. >From JasonTownsend@mail.utexas.edu (Jason Townsend)
  1102. Subject: [Q] How to notify Finder of renamed files?
  1103. Date: Mon, 09 Oct 1995 14:25:47 -0500
  1104. Organization: University of Texas at Austin
  1105.  
  1106. I am working on a CodeWarrior C program called Guillotine that renames
  1107. files in batches with FSpRename (currently makes them all lowercase or all
  1108. uppercase using Text Utilities). I notify the Finder of the change by
  1109. changing the modification date of the enclosing folder so the user must
  1110. close and reopen the window to see the change. It is based on DropShell
  1111. 2.0, so it uses the DropShell ForceFinderUpdate routine. It requires
  1112. System 7 or later.
  1113.  
  1114. I should be able to make the change visible without user intervention. Any
  1115. ideas on how I can do that?
  1116.  
  1117. Any help would be greatly appreciated.
  1118.  
  1119. -Jason
  1120.  
  1121. - ------------  <http://www.ece.utexas.edu/~townsend/>  -------------
  1122. "Whoa, Macs are cool."       |          JasonTownsend@mail.utexas.edu
  1123.           -Me                | LC 575 20/540, MacOS 7.5.1, QDGX 1.1.2
  1124. - -  I believe in emailing courtesy copies of followup articles.  ---
  1125.  
  1126. +++++++++++++++++++++++++++
  1127.  
  1128. >From erichsen@pacificnet.net (Erichsen)
  1129. Date: Mon, 09 Oct 1995 14:47:34 -0700
  1130. Organization: Disorganized
  1131.  
  1132. In article <JasonTownsend-0910951425470001@slip-45-7.ots.utexas.edu>,
  1133. JasonTownsend@mail.utexas.edu (Jason Townsend) wrote:
  1134.  
  1135. >I am working on a CodeWarrior C program called Guillotine that renames
  1136. >files in batches with FSpRename (currently makes them all lowercase or all
  1137. >uppercase using Text Utilities). I notify the Finder of the change by
  1138. >changing the modification date of the enclosing folder so the user must
  1139. >close and reopen the window to see the change. It is based on DropShell
  1140. >2.0, so it uses the DropShell ForceFinderUpdate routine. It requires
  1141. >System 7 or later.
  1142. >I should be able to make the change visible without user intervention. Any
  1143. >ideas on how I can do that?
  1144.  
  1145. I had the same problem with Drop•Rename (my application which does exactly
  1146. what you want but, suffers the same problem you're getting). It seems the
  1147. Finder takes a long time to update items that only have a case change
  1148. (changing the name in other ways will update immediately after bumping the
  1149. date).
  1150.  
  1151. +++++++++++++++++++++++++++
  1152.  
  1153. >From samny@nyc.pipeline.com (Ed Samuels)
  1154. Date: 9 Oct 1995 22:41:40 -0400
  1155. Organization: The Pipeline
  1156.  
  1157. In article <JasonTownsend-0910951425470001@slip-45-7.ots.utexas.edu>, Jason
  1158. Townsend writes: 
  1159.  
  1160. >I should be able to make the change visible without user intervention. Any
  1161.  
  1162. >ideas on how I can do that? 
  1163.  
  1164. You have to send the Finder an "update container items" Apple Event--I
  1165. forget what the 4-letter code is at the moment, but you can easily check it
  1166. by looking at the "aevt"s in a copy of your Finder with Resorcerer. You'll
  1167. need to pass the Finder a list of aliases to the folders that you want to
  1168. update.  
  1169.  
  1170. For some good Apple Event sample code which, although it does not discuss
  1171. the Update Items event in particular, provides a strong background for
  1172. sending almost any Apple Events to the Finder, I recommend the book
  1173. "Ultimate Mac Programming" by Dave Mark et al. The Apple ftp site is also
  1174. bound to have some good examples dealing with the subject. 
  1175.  
  1176. By the way--you and your users will have to have either System 7.5, or 7.1
  1177. with the Finder Scripting Extension installed for this to work. 
  1178.  
  1179. :) 
  1180. ___________________________________ 
  1181. Richard Samuels 
  1182. samny@nyc.pipeline.com
  1183.  
  1184. ---------------------------
  1185.  
  1186. >From jelemans@aurora-net.com (john elemans)
  1187. Subject: how to identify cd volumes
  1188. Date: 9 Oct 1995 21:12:52 GMT
  1189. Organization: hundred peaches inc
  1190.  
  1191. Is there a way to walk the volume list and identify those volumes which are
  1192. CDs? TIA.
  1193. je
  1194.  
  1195. +++++++++++++++++++++++++++
  1196.  
  1197. >From blob@apple.com (Brian Bechtel)
  1198. Date: Mon, 09 Oct 1995 17:22:48 -0700
  1199. Organization: Apple Computer, Inc.
  1200.  
  1201. In article <jelemans-0910951410400001@port16.annex1.disc-net.com>,
  1202. jelemans@aurora-net.com (john elemans) wrote:
  1203.  
  1204. > Is there a way to walk the volume list and identify those volumes which are
  1205. > CDs?
  1206.  
  1207. Unfortunately, there is no good way to determine a CD-ROM drive on a
  1208. Macintosh. Just about every time you think you've come up with a good
  1209. method for detecting CD-ROM drives, some engineer comes up with a way to
  1210. defeat your check (without even knowing that they were accomplishing this
  1211. feat.)
  1212.  
  1213. As an example, here are some of the approaches you can take.
  1214.  
  1215. 1) Look at the drive queue element for a mounted drive and see which
  1216. driver is pointed to by the dQRefNum.  Look at the driver name.  If it's
  1217. ".AppleCD" then it's probably a CD-ROM drive.
  1218.  
  1219. This fails for non-Apple CD-ROM drives which have different driver names.
  1220.  
  1221. 2) Look at the attributes of the drive in the four bytes preceeding the
  1222. drive queue entry.  If it's "locked in hardware" and removable then it's a
  1223. CD-ROM drive.
  1224.  
  1225. This fails because locked removable hard disks or optical media (or even
  1226. floppies) have the same attributes.  Some CD-ROM drivers allow you to
  1227. "write" to a CD-ROM drive (they shadow the file system and write the files
  1228. to a local hard disk, making the local hard disk appear as if it were part
  1229. of the CD-ROM drive.)
  1230.  
  1231. 3) Issue a SCSI request directly to the drive.
  1232.  
  1233. This fails for some early CD-ROM drives (non-SCSI-2 compliant). Before
  1234. SCSI-2, there was no CD-ROM device type defined.  Some CD-ROM drives
  1235. reported back that they were disks instead.  You also have the
  1236. complication of SCSI Manager 4.3 today, and the possibility of IDE CD-ROM
  1237. drives in the future.  The IDE Manager has a completely different calling
  1238. architecture, and I couldn't tell you how to identify IDE CD-ROM drives
  1239. yet, because I haven't seen any yet.
  1240.  
  1241. 4) Issue a ReadTOC() call to the driver and see if the result that comes
  1242. back is reasonable.
  1243.  
  1244. Although a Control() call with csCode 100 is a "famous" CD-ROM driver
  1245. call, there is nothing which prevents other drivers from implementing that
  1246. call.  In practice, few do, but it is entirely possible for a different
  1247. driver to implement that call with different values in csParam.  This can
  1248. be disasterous.
  1249.  
  1250. If I were trying to detect a CD-ROM drive, I'd take approach 4.  For each
  1251. mounted drive, issue a ReadTOC call to the driver for that drive.  If you
  1252. get back reasonable results, then you're probably talking to a CD-ROM
  1253. drive.
  1254.  
  1255. References:
  1256.  
  1257. DV 22, CD-ROM Driver Calls
  1258. Inside Macintosh:Devices, SCSI Manager 4.3 chapter
  1259. Developer Note on Quadra 630, IDE Manager
  1260.  
  1261. -- 
  1262. --Brian Bechtel    blob@apple.com    "My opinion, not Apple's"
  1263.   Village Idiot, DTS
  1264.  
  1265. +++++++++++++++++++++++++++
  1266.  
  1267. >From mclow@coyote.csusm.edu (Marshall Clow)
  1268. Date: Tue, 10 Oct 1995 20:37:50 -0700
  1269. Organization: Aladdin Systems
  1270.  
  1271. In article <jelemans-0910951410400001@port16.annex1.disc-net.com>,
  1272. jelemans@aurora-net.com (john elemans) wrote:
  1273.  
  1274. >Is there a way to walk the volume list and identify those volumes which are
  1275. >CDs? TIA.
  1276. >je
  1277.  
  1278. Not really.
  1279.  
  1280. You can look for large read only volumes.
  1281. -- Of course, locked ZIP drives can qualify
  1282.  
  1283. You can look for volumes that use the driver '.AppleCD'
  1284. -- But third party CD players may not use Apple's driver
  1285.  
  1286. You can apply other heuristics.
  1287.  
  1288. But AFAIK, there is no way to positively identify a CD.
  1289.  
  1290.  
  1291. -- Marshall
  1292.  
  1293. -- 
  1294. "They that can give up essential liberty to obtain a little temporary
  1295.  safety deserve neither liberty nor safety." -- Benjamin Franklin
  1296.  _Historical Review of Pennsylvania_, 1759
  1297.  
  1298. ---------------------------
  1299.  
  1300. End of C.S.M.P. Digest
  1301. **********************
  1302.